package com.yyx.lgb.common.exception;


import com.yyx.lgb.model.vo.common.ResultCodeEnum;
import lombok.Data;

//自定义异常
@Data
public class LgbException extends RuntimeException {

    private Integer code;
    private String message;
    private ResultCodeEnum resultCodeEnum;

    public LgbException(ResultCodeEnum resultCodeEnum) {
        this.resultCodeEnum = resultCodeEnum;
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();

    }

    public LgbException(Integer code, String message){
        this.code = code;
        this.message = message;
    }

}
